package org.jet.emall.common.constant;

import lombok.Getter;

/**
 * @author xiaozai
 * @version 1.0
 * @date 2020-04-30 14:14
 */

public enum PaymentType {

    /**
     *
     */
    CASH((byte)1,"现金"),
    BALANCE((byte)2, "余额"),
    ON_LINE_BANK((byte)3, "网银"),
    ALIPAY((byte)4, "支付宝"),
    WECHAT((byte)5, "微信");


    @Getter
    private Byte value;
    @Getter
    private String info;

    private PaymentType(Byte value,String info){
        this.value = value;
        this.info = info;
    }


    public static PaymentType valueOf(Byte value){
        switch (value){
            case 1: return CASH;
            case 2: return BALANCE;
            case 3: return ON_LINE_BANK;
            case 4: return ALIPAY;
            case 5: return WECHAT;
            default:return BALANCE;
        }
    }
}
